#include <stdio.h>

int main(int argc, char *argv[])
{
	int n, i;
	int a[20] = {0};

	scanf("%d", &n);

	i = 0;
	while (n>=1) {
		a[i] = n % 2;
		n = n / 2;
		i++;
	}

	for (i=0; i<20; i++) {
		if (a[i] == 1) printf("%d ", i);
	}
	printf("\n");

	return 0;
}
